﻿@model PagedList<BulletinModel.Feedback>
 @using Webdiyer.WebControls.Mvc;
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.raty.js")" type="text/javascript"></script>
@{
    ViewBag.Title = "GetAllComment";
}
<script>
    $(document).ready((function () {
        $(".nonejscommentlist").hide();
    }))
 </script>
<script type="text/jscript">
    //function confirmDel(itemId) {
    //    if (confirm("确认删除吗?")) {
    //        window.location.href = "/UserInfo/Delete/" + itemId;
    //    }
    //}
    function selectAll() {
        var checked = $("#ckAll").attr("checked");
        $("input[name='ckSelect']").attr("checked", checked);
        if (checked) {
            $("#spInfo").html("反选");
        } else {
            $("#spInfo").html("全选");
            $("input[name='ckSelect']").attr("checked", false);
        }
    }

    function delIds() {
        if (confirm("确认要删除选中数据吗?")) {
            var checkedCount = $("input[name='ckSelect']:checked").length;
            if (checkedCount > 0) {
                $("form").first().submit(); //提交表单
            } else {
                alert("请先选择操作项!");
            }

        }
    }

</script>


<h2>所有评价</h2>
<div id="operate">
              @if(User.Identity.Name != "") 
      { 
<input type="button" onclick="delIds();" value="批量删除" /><span>&#8195;</span>
              }

@Html.ActionLink("返回","giveComment", "BulletinItem", new { projectSN =  ViewData["projectSN"], YeMa = ViewData["YeMa"], BulletinYaMa = ViewData["BulletinYaMa"] },null)
</div>

<fieldset class="show">


@using (Html.BeginForm("BatchDelete", "Feedback", FormMethod.Post))
{
    
        <div class="display-label">
            项目名：
        </div>
        <div class="display-field">
            @ViewData["bulletinmane"]
        </div>
        <div class="display-label">
            课题名：
        </div>
        <div class="display-field">
            @ViewData["projectname"]
        </div>
        <div class="display-label">
            课题编号：
        </div>
        <div class="display-field">
            @ViewData["projectSN"]
        </div>
    
    @Html.Hidden("BulletinYaMa",ViewData["BulletinYaMa"]);
     @Html.Hidden("YeMa",ViewData["YeMa"]);
        @Html.Hidden("projectSN",ViewData["projectSN"]);
<table class="oddTable">
    <tr>
         
                 @if (User.Identity.Name != "") 
      { <th>
       <input type="checkbox" name="ckAll" id="ckAll" onclick="selectAll();" /><span id="spInfo"> 全选</span>
        </th>}
        <th>
          评价详细列表
       </th>
         <th>
          评价等级
       </th>
       @if (User.Identity.Name != "") 
      { <th>操作</th>
        }
    </tr>
     
@foreach (var item in Model)
{   
       
     <tr>
                   @if (User.Identity.Name != "") 
      { 
         <td style="width:50px;">@Html.CheckBox("ckSelect", false, new { value = item.ID })</td>
                   }
        <td>
            @Html.DisplayFor(modelItem => item.TextValue)
        </td>
        <td><div style="float:left;">星级：</div>
         <div class="nonejscommentlist" style="float:left;">
             
                 @for (int i = 1; i <=item.StarValue; i++)
                     { 
                     <img src="../../Content/StarImg/star-on.png" />
                  }
                </div>
      <script type="text/javascript">
          $(function () {
              $('#@item.ID').raty(
               {
                   path: "../../Content/StarImg",
                   starHalf: 'star-half-big.png',
                   readOnly: true,
                   showHalf: true,
                   score: '@item.StarValue'
               }
              );
         })
                </script>
             <div id="@item.ID" style="float:left;margin-top:2px;"></div>
        </td>
          @if (User.Identity.Name != "") 
      { 
         <td style="width:50px;">@Html.ActionLink("删除", "DeleteCommentByIDintotal", new {ID=item.ID,projectSN=ViewData["projectSN"] ,BulletinYaMa=ViewData["BulletinYaMa"],YeMa=ViewData["YeMa"],onclick = string.Format("return confirm('确定要删除吗?')")})</td>
      }
    </tr>
}
</table>   
}
   @Html.Pager( Model ,new PagerOptions()
        {
    PageIndexParameterName = "id",
    ShowPageIndexBox = true,
    ShowGoButton = true,
    PageIndexBoxWrapperFormatString = "跳转到第{0}页"
        })
</fieldset>